#include <stdio.h>
#include <stc8h.h>
#include "intrins.h"
#include "uart1.h"
#include "adc1.h"
void Delay1ms(void)	//@22.1184MHz
{
	unsigned char data i, j;

	i = 29;
	j = 183;
	do
	{
		while (--j);
	} while (--i);
}

void main(void){
	int i;
	int s;
    unsigned int xdata * verfprt;
    verfprt=(unsigned int xdata *) 0xfde7;

	P0M0 = 0x00; P0M1 = 0x00; 
    P1M0 = 0x00; P1M1 = 0x00; 
    P2M0 = 0x00; P2M1 = 0x00; 
    P3M0 = 0x00; P3M1 = 0x00; 
    P4M0 = 0x00; P4M1 = 0x00; 
    P5M0 = 0x00; P5M1 = 0x00; 
    P6M0 = 0x00; P6M1 = 0x00; 
    P7M0 = 0x00; P7M1 = 0x00; 
	Uart1_Init();
	ADCInit();
	printf("%d",*verfprt);
	printf("%d",ADCRead());
	for (i=2000;i<6000;i+=100){
	s=((3300/(i/100))-65)/5;
	// s=(int)((s-65)/5);
	printf("v:%d s: %d \r\n",i,s);
	}
	UartSend(0xff);
	while (1)
	{
		runcmd();
	}
	
 }